package com.tdam2014.grupo01.objects;

import org.json.JSONObject;

public class Photo {

	private String id;
	private String secret;
	private String server;
	private String farm;
	private String title;
	private String isPrimary;
	private String isPublic;
	private String date;
	private String photoset_id;
	private String urlFoto; //necesito la url de la foto, para no volver a armarla

	public Photo(JSONObject objPhoto) {
		id = objPhoto.optString("id");
		secret = objPhoto.optString("secret");
		server = objPhoto.optString("server");
		farm = objPhoto.optString("farm");
		title = objPhoto.optString("title");
		isPrimary = objPhoto.optString("isPrimary");
		isPublic = objPhoto.optString("isPublic");

		// falta date
	}

	public String getUrlFoto() {
		return urlFoto;
	}

	public void setUrlFoto(String urlFoto) {
		this.urlFoto = urlFoto;
	}

	public Photo() {
		
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getServer() {
		return server;
	}

	public void setServer(String server) {
		this.server = server;
	}

	public String getFarm() {
		return farm;
	}

	public void setFarm(String farm) {
		this.farm = farm;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String isPrimary() {
		return isPrimary;
	}

	public void setPrimary(String isPrimary) {
		this.isPrimary = isPrimary;
	}

	public String isPublic() {
		return isPublic;
	}

	public void setPublic(String isPublic) {
		this.isPublic = isPublic;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getIsPrimary() {
		return isPrimary;
	}

	public void setIsPrimary(String isPrimary) {
		this.isPrimary = isPrimary;
	}

	public String getIsPublic() {
		return isPublic;
	}

	public void setIsPublic(String isPublic) {
		this.isPublic = isPublic;
	}

	public String getPhotoset_id() {
		return photoset_id;
	}

	public void setPhotoset_id(String photoset_id) {
		this.photoset_id = photoset_id;
	}

	@Override
	public boolean equals(Object object) {
		boolean sameSame = false;
		if (object != null && object instanceof Photo) {
			sameSame = this.getId().equalsIgnoreCase(((Photo) object).getId());
		}
		return sameSame;
	}
}
